package com.yjd.pub.system.service;

import java.util.HashMap;
import java.util.Map;

import javax.annotation.Resource;
import org.springframework.stereotype.Service;

import com.yjd.comm.base.dao.IBaseDao;
import com.yjd.comm.base.service.impl.BaseServiceImpl;
import com.yjd.comm.system.model.UserPicsDataModel;
import com.yjd.comm.system.service.IUserPicsDataService;
import com.yjd.pub.system.dao.IUserPicsDataDao;

/**
 * <b>description</b>：用户认证图片业务实现<br>
 * <b>time</b>：2014-12-11 20:17:33 <br>
 * <b>author</b>：  ready likun_557@163.com
 */
@Service("userPicsDataService")
public class UserPicsDataServiceImpl extends BaseServiceImpl implements IUserPicsDataService {

	/**
	 * 插入
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public UserPicsDataModel insert(UserPicsDataModel model) throws Exception {
		return this.userPicsDataDao.insertModel(model, true);
	}

	/**
	 * 更新
	 * 
	 * @param model
	 * @return
	 * @throws Exception
	 */
	public int update(UserPicsDataModel model) throws Exception {
		return this.userPicsDataDao.updateModel(model, true);
	}

	/**
	 * 根据id删除
	 * 
	 * @param user_id
	 * @return
	 * @throws Exception
	 */
	public int delete(Long user_id) throws Exception {
		Map<Object, Object> paramMap = new HashMap<Object, Object>();
		paramMap.put("user_id", user_id);
		return this.userPicsDataDao.deleteModel(paramMap, true);
	}

	@Resource
	private IUserPicsDataDao userPicsDataDao;

	@Override
	public IBaseDao getBaseDao() {
		return this.userPicsDataDao;
	}

}
